package megrez.boot.autoconfigure.okhttp.metrics;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.boot.context.properties.ConfigurationProperties;

import lombok.Data;
import okhttp3.Request;

/**
 * 指标配置项
 *  
 * @author Lucky Yang
 * @since 2.6.9
 */
@Data
@ConfigurationProperties("okhttp.metrics")
public class OkHttpMetricsProperties {
    private boolean enabled;

    /**
     * 指标名称
     */
    private String name = "okhttp";

    /**
     * 是否包含 {@code host} 标签
     *
     * @see OkHttpMetricsEventListener.Builder#includeHostTag(boolean)
     */
    private boolean includeHostTag = true;

    /**
     * Tag keys for {@link Request#tag()} or {@link Request#tag(Class)}.
     *
     * @see OkHttpMetricsEventListener.Builder#requestTagKeys(Iterable)
     */
    private List<String> requestTagKeys = new ArrayList<>();

    /**
     * @see OkHttpMetricsEventListener.Builder#tags(Iterable)
     */
    private Map<String, String> tags = new HashMap<>();
}
